import { axios } from '@/service/service'
import { ListReq, userFormReq } from './types'

export function getUserList(
  params: ListReq,
  page: number,
  pageSize: number
): any {
  return axios({
    url: '/system/SysUsercentre/list',
    method: 'post',
    data: { ...params, page, pageSize },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}

export function editUser(params: userFormReq): any {
  return axios({
    url: '/system/SysUsercentre/edit',
    method: 'post',
    data: { ...params },
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    transformRequest: (params) => JSON.stringify(params)
  })
}
